//
//  TestYJCDowloadController.m
//  ProjectDemo
//
//  Created by IOS3 on 2019/1/25.
//  Copyright © 2019 IOS3. All rights reserved.
//

#import "TestYJCDowloadController.h"

@interface TestYJCDowloadController ()

@property (nonatomic, strong) NSArray *datas;

@end

@implementation TestYJCDowloadController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self getDownloadResource];
    
    
}

- (void)getDownloadResource {
    NSData *data = [NSData dataWithContentsOfFile:[NSBundle.mainBundle pathForResource:@"TestResource" ofType:@"json"]];
    id obj = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
    NSMutableArray *datas = [NSMutableArray array];
    if ([obj isKindOfClass:NSArray.class]) {
        NSArray *rootArr = (NSArray *)obj;
        for (id node in rootArr) {
            NSMutableArray *section = [NSMutableArray array];
            if ([node isKindOfClass:NSArray.class]) {
                for (NSString *str in (NSArray *)node) {
                    [section addObject:str];
                }
            }
            [datas addObject:section.copy];
        }
    }
}



@end
